#ifndef CLUSTER_HPP
#define CLUSTER_HPP

#include <vector>



#include "GraphHandler.hpp"


struct Cluster
{
    Cluster() : pParent(0) {}

    ~Cluster()
    {
        for(int i=0; i < pChildren.size(); i++)
            delete pChildren[i];
        pChildren.clear();
    }

    // A vector pointing to all the graphs belonging to this cluster
    //std::vector<GraphHandler::Graph*> pGraphs;
    std::vector<int> pGraphs;

    std::vector<Cluster*> pChildren;
    Cluster* pParent;

    // The graph which all members of this cluster shares
    GraphHandler::Graph kMeta;


    template<class Archive>
    void serialize(Archive &ar, const unsigned int version)
    {
        ar & pParent;
        ar & kMeta;
        ar & pGraphs;
        ar & pChildren;

        /*
        // Save the ID of each graph of this cluster
        for(int i=0; i < pGraphs.size(); i++)
            GraphHandler::Instance().GetGraphID(pGraphs[i]);

        for(int i=0; i < pChildren.size(); i++)
            ar & (*pChildren[i]);*/
    }


};

#endif // CLUSTER_HPP
